//声明包
package com.itheima.dianming;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Random;
import java.util.Scanner;

public class Test {

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入要点名的人数");
        int num = sc.nextInt();
        for (int i = 0; i < num; i++) {
            diaming();
        }

    }

    private static void diaming() throws IOException {
        ArrayList<String> list = new ArrayList<>();
        BufferedReader reader = new BufferedReader(new FileReader("名单.txt"));
        String name;
        while ((name=reader.readLine())!=null){
            list.add(name);
        }

        Random r = new Random();
        int i = r.nextInt(list.size());
        System.out.println(list.get(i));
    }
}
